﻿using System;
using System.Collections.Generic;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using Kaskelot.SP.Core;
using Kaskelot.SP.Model.Contracts;
using Kaskelot.SP.Services;
using Stockholm.SOA.Kaskelot.WCF.DataContracts;

namespace Kaskelot.SP.UI.CONTROLTEMPLATES.Kaskelot.SP.UI.Forms
{
	public partial class FunktionForm : BaseForm, IForm
	{
		public string Id { get; set; }
		public string ParentId { get; set; }
		public Funktion Current { get; set; }

		protected void Page_Load(object sender, EventArgs e)
		{
			using (AdminService svc = new AdminService())
			{
				if(Id.IsGuid())
					Current = svc.GetFunktion(new Guid(Id));

				if (Current == null)
					Current = new Funktion();

				IList<ListItem> typer = new List<ListItem>();
				typer.Add(new ListItem { Text = "Fast", Value = "true" });
				typer.Add(new ListItem { Text = "Tim", Value = "false" });

				ErsattningRepeater.DataSource = typer;
				ErsattningRepeater.DataBind();
			}
		}
	}
}
